package leetcode_301_400;

public class LeeCode_338 {
    public static void main(String[] args) {

    }
    private static int[] countBits(int n) {
        int[] ans = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            ans[i] = ans[i & (i - 1)] + 1;
        }
        return ans;
    }
}
